
import { defineConfig } from 'vite';
import uni from '@dcloudio/vite-plugin-uni';
import { resolve } from 'path';
export default defineConfig({
  plugins: [uni()],
  resolve: {
    alias: {
      '@': resolve(__dirname, 'src')
    }
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: '@import "./src/uni.scss";'
      }
    }
  },
  server: {
    port: 3000,
    open: true,
    proxy: {
      "/yueyang": {
        target: "http://localhost:8080",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/yueyang/, "/yueyang"),
      },
      "/pyh": {
        target: "http://localhost:8080",
        changeOrigin: true,
       rewrite: (path) => path.replace(/^\/pyh/, "/pyh"),
      },
    },
  },
  build: {
    outDir: 'dist',
    assetsDir: 'static',
    sourcemap: false
  },
    optimizeDeps: {
    include: ['./src/utils/qqmap-wx-jssdk.js']
  }
});
